-
Notifications
You must be signed in to change notification settings - Fork 92
tasks 223-232 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tasks 223-232 #62
Conversation
Kudos, SonarCloud Quality Gate passed! |
|
||
**Output:** \[null, null, null, 1, 1, false\] | ||
|
||
**Explanation:** MyQueue myQueue = new MyQueue(); myQueue.push(1); // queue is: \[1\] myQueue.push(2); // queue is: \[1, 2\] (leftmost is front of the queue) myQueue.peek(); // return 1 myQueue.pop(); // return 1, queue is \[2\] myQueue.empty(); // return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be changed with ident format.
assertThat(stack.top, equalTo(2)); | ||
|
||
assertThat(stack.pop(), equalTo(2)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty lines may be removed.
|
||
**Output:** \[null, null, null, 2, 2, false\] | ||
|
||
**Explanation:** MyStack myStack = new MyStack(); myStack.push(1); myStack.push(2); myStack.top(); // return 2 myStack.pop(); // return 2 myStack.empty(); // return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be changed with the ident format.
|
||
public int calculate(String s) { | ||
char[] ca = s.toCharArray(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty line may be removed.
strB.append("->").append(b); | ||
} | ||
|
||
ranges.add(strB.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty line may be removed.
int popValue = queueOne.remove(); | ||
queueOne.addAll(queueTwo); | ||
queueTwo.clear(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty line may be removed.
} | ||
|
||
public int helper(char[] ca) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty line may be removed.
No description provided.